<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:include href='../xsl.include.main.xsl'/>

<xsl:template name="monthName">
 <xsl:param name="month"/>
 <xsl:choose>
   <xsl:when test="$month=1">Gennaio</xsl:when>
   <xsl:when test="$month=2">Febbraio</xsl:when>
   <xsl:when test="$month=3">Marzo</xsl:when>
   <xsl:when test="$month=4">Aprile</xsl:when>
   <xsl:when test="$month=5">Maggio</xsl:when>
   <xsl:when test="$month=6">Giugno</xsl:when>
   <xsl:when test="$month=7">Luglio</xsl:when>
   <xsl:when test="$month=8">Agosto</xsl:when>
   <xsl:when test="$month=9">Settembre</xsl:when>
   <xsl:when test="$month=10">Ottobre</xsl:when>
   <xsl:when test="$month=11">Novembre</xsl:when>
   <xsl:when test="$month=12">Dicembre</xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$month"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

<xsl:template match="birthdays">

<table bgcolor="#FFFFFF" class="body" border="0" cellspacing="0" cellpadding="3" width="100%">
<tr>
	<td class="CDB" style="border-top:1px solid #666666;" bgcolor="#EFEFCE" width="1px">&#160;</td>
	<xsl:for-each select="wday">
		<td class="CDBf10c" style="border-top:1px solid #666666;" bgcolor="#EFEFCE" align="center" width="80px">
			<xsl:value-of select="@shortname"/><br/>
			<xsl:value-of select="@dayOfMonth"/>
		</td>
	</xsl:for-each>
	<td class="CDB" style="border-top:1px solid #666666;" bgcolor="#EFEFCE" width="1px">&#160;</td>
</tr>
<tr>
	<td></td>


<xsl:for-each select="wday">
	<xsl:variable name="dayOfMonth">
		<xsl:value-of select="@dayOfMonth"/>
	</xsl:variable>

  <td class="CDLf10c" align="left" valign="top">
	<table bgcolor="#FFFFFF" class="body" border="0" cellspacing="0" cellpadding="3" width="100%">
		<xsl:for-each select="/birthdays/row[@giorno=$dayOfMonth]">
				<tr>
					<td class="CDBf10" align="left" valign="top">

						<nobr>
	<xsl:call-template name="user">
		<xsl:with-param name="status" select="@uStatus"/>
		<xsl:with-param name="sexid" select="@sexid"/>
		<xsl:with-param name="certified" select="@certified"/>
		<xsl:with-param name="userid" select="@userid"/>
		<xsl:with-param name="nick" select="@nick"/>
		<xsl:with-param name="bold" select="/activity/@loggedUser=@userid"/>
		<xsl:with-param name="buddy" select="0"/>
		<xsl:with-param name="newbie" select="@dayiscr&lt;15 and ( floor( /activity/@loggedStatus div 4) mod 4 or floor( /activity/@loggedStatus div 16) mod 16 or floor( /activity/@loggedStatus div 32) mod 32 )"/>
	</xsl:call-template>
						</nobr>


						<br/>


						<b><xsl:value-of select="@eta"/></b> &#160;&#160;<xsl:value-of select="substring(@birthdate,9,2)"/>/<xsl:value-of select="substring(@birthdate,6,2)"/>/<xsl:value-of select="substring(@birthdate,1,4)"/><br/>
						(<xsl:value-of select="@city"/>)
						<a class="body_10px_red" href="/mailbox/mailboxWrite.aspx?receiverGuid={@userid}"><img src="/imgs/mail_icon.jpg" border="0" heigth="15" width="15"/></a>

					</td>
				</tr>
		</xsl:for-each>
	</table>
</td>

</xsl:for-each>


<td class="CDLf10c" width="1px">&#160;</td>
</tr>

</table>
<p/>
<center>Sono elencati i compleanni che cadono nei prossimi 14 giorni,<br/>sono presi in considerazione esclusivamente gli utenti che si sono loggati almeno una volta negli ultimi 10 giorni.</center>
</xsl:template>

</xsl:stylesheet>